<me:UIVVT x:Class="WPFExcelReport.TWV03WB06"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WBB="clr-namespace:WPFExcelReport;assembly=TWBBST"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                   x:Name="TV" 
                    Loaded="Window_Loaded"
     >
    <me:UIVVT.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:M2YD x:Key="M2YD"/>
    </me:UIVVT.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel   Grid.Row="0" Grid.Column="0"  >
            <WrapPanel Visibility="{Binding IsCanNew,ElementName=TV,Converter={StaticResource bv}}" >
                <CheckBox Content="{Binding Source={Localization:Translate Word=全屏}}" IsChecked="{Binding IsZoneWBFull,ElementName=TV}" VerticalAlignment="Top"></CheckBox>

                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=当前箱号}}"/>
                <ex:TXT72 Margin="5,0,0,0"  PRE="0000" MaxLength="4" FontSize="24"  Grid.Column="1"   Text="{Binding PACKNR,ElementName=TV}" Width="80"/>
                <Button Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button> 
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=新箱号}}"/>
                <Button Click="AutoPackCommand" Height="20" Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=自动分箱}}"/>                
                <Button Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                    </Button.Background>
                </Button>
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=点击-新箱号，然后双击布卷，则分配箱号。右键单击会取消箱号。}}"/>
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=自动分箱会每个颜色挑选一个布卷}}"/>
            </WrapPanel>
            <WrapPanel Visibility="{Binding IsCanNew,ElementName=TV,Converter={StaticResource nbv}}" >
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=当前卷号：}}"/>
                <ex:TXT72 Margin="5,0,0,0"    MaxLength="12" FontSize="24"  Grid.Column="1" 
                          KeyUp="Query_KeyUp"
                          IsAutoClear="True"
                          Text="{Binding STKNR,ElementName=TV}" Width="250"/>
                <TextBlock Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=箱号:}}"/>
                <TextBlock Margin="5,0,0,0"   FontSize="24"  Grid.Column="1"   Text="{Binding PACKNR,ElementName=TV}" MinWidth="80" Foreground="Red"/>
            </WrapPanel> 
        </StackPanel>
        <ex:AniScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"  >
            <WrapPanel>
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="1"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG"
                     Visibility="{Binding IsVVKEY1,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY1,ElementName=TV}"
                              IsCanNew="{Binding IsCanNew,ElementName=TV}"
                          PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                             IsAuto="{Binding IsAuto,ElementName=TV}"
                              FreeWBB="{Binding FreeWBB,ElementName=TV}"
                             IsEdit="{Binding IsEdit,ElementName=TV}"
                              IsSaved="{Binding IsSaved,ElementName=TV}"
                     />
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="2"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG"
                        Visibility="{Binding IsVVKEY2,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY2,ElementName=TV}"
                             IsCanNew="{Binding IsCanNew,ElementName=TV}"
                             PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                             IsAuto="{Binding IsAuto,ElementName=TV}"
                              FreeWBB="{Binding FreeWBB,ElementName=TV}"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                             IsSaved="{Binding IsSaved,ElementName=TV}"
                             
                     />
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="3"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG"
                        Visibility="{Binding IsVVKEY3,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY3,ElementName=TV}"
                             IsCanNew="{Binding IsCanNew,ElementName=TV}"
                             PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                              IsAuto="{Binding IsAuto,ElementName=TV}"
                              FreeWBB="{Binding FreeWBB,ElementName=TV}"
                               IsEdit="{Binding IsEdit,ElementName=TV}"
                             IsSaved="{Binding IsSaved,ElementName=TV}"
                            
                     />
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="4"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG"
                      Visibility="{Binding IsVVKEY4,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY4,ElementName=TV}"
                             IsCanNew="{Binding IsCanNew,ElementName=TV}"
                             PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                              IsAuto="{Binding IsAuto,ElementName=TV}"
                              FreeWBB="{Binding FreeWBB,ElementName=TV}"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                             IsSaved="{Binding IsSaved,ElementName=TV}"
                     />
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="5"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG"
                        Visibility="{Binding IsVVKEY5,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY5,ElementName=TV}"
                             IsCanNew="{Binding IsCanNew,ElementName=TV}"
                             PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                              IsAuto="{Binding IsAuto,ElementName=TV}"
                              FreeWBB="{Binding FreeWBB,ElementName=TV}"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                             IsSaved="{Binding IsSaved,ElementName=TV}"
                     />
                <WBB:TDTWB06 Grid.Row="1" Grid.Column="6"
                     SLO="01" SLB="CP"   LO="01" LB="CW"  LP="01      " 
                        IsPage="True"
                        Rows="50"
                        FTAUTOSUM="True" 
                        SKEY1="WBBART"
                        KEY1="WBBISTKLG" 
                       Visibility="{Binding IsVVKEY6,ElementName=TV,Converter={StaticResource bv}}"
                     EXAUF="{Binding VVKEY6,ElementName=TV}"
                             IsCanNew="{Binding IsCanNew,ElementName=TV}"
                       PACKNR="{Binding PACKNR,ElementName=TV}"
                             STKNR="{Binding STKNR,ElementName=TV}" 
                        IsAuto="{Binding IsAuto,ElementName=TV}"
                          FreeWBB="{Binding FreeWBB,ElementName=TV}"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                             IsSaved="{Binding IsSaved,ElementName=TV}" 
                     />
            </WrapPanel>
        </ex:AniScrollViewer>
    </Grid>
</me:UIVVT>
